#!/bin/sh

if [ ! -d "/sys/class/gpio/gpio82" ]; then
    echo 82 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio82/direction
fi

if [ "$1" = "0" ]; then
    echo 0 > /sys/class/gpio/gpio82/value
    echo "$(date):output1 关  测试成功" >> /userfs/all.txt
elif [ "$1" = "1" ]; then
    echo 1 > /sys/class/gpio/gpio82/value
    echo "$(date):output1 开   测试成功" >> /userfs/all.txt
else
    echo "Invalid argument. Please provide either 0 or 1."
fi

echo "gpio_out_1 Begin execution"